import {ProtocolReactor} from './src/ProtocolReactor'
import {FF55Protocol} from './src/ProtocolMiddleware/FF55Protocol'

let pr = new ProtocolReactor()
let p = new FF55Protocol()
pr.addProtocol(p)
setTimeout(() => {
    pr.feedHex('ff55334455039798990d0a')
}, 1000);
let main = async() => {
    let [b,
        s,
        str] = await pr.asyncMatch('FF55', ['byte', 'short', 'string'])
    expect(b).toBe(parseInt('33'))
    expect(s).toBe(parseInt('4455'))
    console.log(str)
};

main()
